#include <iostream>

using namespace std;

const int N = 3e5 + 10;

int n;
int arr[N];

int main()
{
	cin >> n;

	for (int i = 1; i <= n; i++)
		cin >> arr[i];

	int sum = 0;
	for (int i = 1; i <= n; i++)
	{
		int x = arr[i];
		while (x > 0)
		{
			sum += x % 10;
			x /= 10;
		}
	}

	cout << sum << endl;

	return 0;
}